
module.exports = app => {

    return class HomeController extends app.Controller {

        async list() {
            await this.ctx.render('notice/index.js');
        }

        async data() {
            let data = await this.ctx.service.notice.list();
            this.success(data)
        }

        async detail() {
            let id = this.ctx.params.id;
            let notice = await this.ctx.service.notice.detail({ id });
            await this.ctx.render('notice/detail/index.js', { notice });
        }


    };
};
